//
//  JYJVCOfAnthorHeadImage.m
//  HappyListen
//
//  Created by 冀永金 on 16/9/20.
//  Copyright © 2016年 冀永金. All rights reserved.
//

#import "JYJVCOfAnthorHeadImage.h"
#import "Masonry.h"
#import "JYJTAMacro.h"
#import "UIImageView+WebCache.h"
@interface JYJVCOfAnthorHeadImage ()
@property (nonatomic, strong) UIImageView *image;
@end

@implementation JYJVCOfAnthorHeadImage

- (void)viewDidLoad {
    [super viewDidLoad];
     self.view.backgroundColor = [UIColor colorWithRed:0.07 green:0.07 blue:0.08 alpha:1.00];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"fanhui"] style:UIBarButtonItemStylePlain target:self action:@selector(back)];
    self.image = [[UIImageView alloc]init];
    [self.view addSubview:_image];
    [self.image mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view.mas_top).with.offset(SCREEN_HEIGHT / 5);
        make.left.equalTo(self.view.mas_left).with.offset(0);
        make.right.equalTo(self.view.mas_right).with.offset(0);
        make.height.mas_equalTo(SCREEN_HEIGHT / 2);
    }];
    
    // Do any additional setup after loading the view.
}
- (void)back {
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    if (self.imageDic) {
        self.navigationItem.title = self.imageDic[@"item_manager"];
        [self.image sd_setImageWithURL:[NSURL URLWithString:self.imageDic[@"item_managerimg"]] placeholderImage:PLACEHOLDERIMAGE];
    }else {
        self.navigationItem.title = self.dic[@"nickname"];
        [self.image sd_setImageWithURL:[NSURL URLWithString:self.dic[@"userimg"]] placeholderImage:PLACEHOLDERIMAGE];
    }
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
